/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chessgame;

import com.hoaptt.model.BoardPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Toolkit;

/**
 *
 * @author ThuHoa
 */
public class ToolBar extends JPanel {

    public ToolBar(Dimension size) {
        setOpaque(true);
        setPreferredSize(size);
//        setBackground(new Color(51, 102, 255));
        setBackground(Color.white);
    }

    public static void main(String[] args) {
        Dimension size = new Dimension(40, 40);
        Dimension size1 = new Dimension(50, 50);
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

        // JFrame 

        JFrame frame = new JFrame("China chess");
        frame.setSize(700, 700);
        frame.setLayout(new BorderLayout());
        frame.setVisible(true);
        frame.setLocation(screen.width / 2 - frame.getSize().width / 2, screen.height / 2 - frame.getSize().height / 2 - 20);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //create a JPanel toolBar
        ToolBar toolBar = new ToolBar(size);
        frame.add(toolBar, BorderLayout.WEST);
        JLabel reset = new JLabel("Reset", JLabel.CENTER);
        toolBar.add(reset);
        //create a JPanel toolBar
        ToolBar toolBar1 = new ToolBar(size);
        frame.add(toolBar1, BorderLayout.NORTH);
        //create a JPanel toolBar
        ToolBar toolBar2 = new ToolBar(size);
        frame.add(toolBar2, BorderLayout.SOUTH);
        //
        ToolBar toolBar3 = new ToolBar(size);
        frame.add(toolBar3, BorderLayout.EAST);
        // create BoardPanel
        BoardPanel panel = new BoardPanel();
        frame.add(panel, BorderLayout.CENTER);

    }
}
